package com.iman.Confucius.mappers;

import com.iman.Confucius.mappers.models.DrmStudyDmsg;
import com.iman.Confucius.mappers.models.DrmStudyDmsgExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmStudyDmsgMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int countByExample(DrmStudyDmsgExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int deleteByExample(DrmStudyDmsgExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Delete({
        "delete from drm_study_dmsg",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Insert({
        "insert into drm_study_dmsg (id, user_id, ",
        "user_name, course_id, ",
        "course_nm, operater_dt, ",
        "category_id, category_nm, ",
        "operater_tp)",
        "values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
        "#{userName,jdbcType=VARCHAR}, #{courseId,jdbcType=BIGINT}, ",
        "#{courseNm,jdbcType=VARCHAR}, #{operaterDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{categoryId,jdbcType=BIGINT}, #{categoryNm,jdbcType=VARCHAR}, ",
        "#{operaterTp,jdbcType=INTEGER})"
    })
    int insert(DrmStudyDmsg record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int insertSelective(DrmStudyDmsg record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    List<DrmStudyDmsg> selectByExample(DrmStudyDmsgExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Select({
        "select",
        "id, user_id, user_name, course_id, course_nm, operater_dt, category_id, category_nm, ",
        "operater_tp",
        "from drm_study_dmsg",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmStudyDmsg selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmStudyDmsg record, @Param("example") DrmStudyDmsgExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByExample(@Param("record") DrmStudyDmsg record, @Param("example") DrmStudyDmsgExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    int updateByPrimaryKeySelective(DrmStudyDmsg record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_dmsg
     *
     * @mbggenerated Sun Sep 13 18:58:23 CST 2015
     */
    @Update({
        "update drm_study_dmsg",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "course_id = #{courseId,jdbcType=BIGINT},",
          "course_nm = #{courseNm,jdbcType=VARCHAR},",
          "operater_dt = #{operaterDt,jdbcType=TIMESTAMP,typeHandler=com.tuan800.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "category_id = #{categoryId,jdbcType=BIGINT},",
          "category_nm = #{categoryNm,jdbcType=VARCHAR},",
          "operater_tp = #{operaterTp,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmStudyDmsg record);
}